package lab02.test20;

import java.util.Scanner;

public class Test20 {
    public static void main(String[] args) {
        //用户从键盘输入一行含有数字和字符的字符串，程序仅仅输出字符串中的全部数字字符。
        System.out.println("请输入一行含有数字字符的字符串：");
        Scanner result = new Scanner(System.in);
        String str = result.nextLine();

        char[] arr = str.toCharArray();
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] >= '0' && arr[i] <= '9') {
                System.out.print(arr[i]);
            }
        }
    }
}